package cn.mystylefree.domain;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

/**
 * @program my-project-model
 * @description:
 * @author: lee
 * @create: 2022/06/10 09:18
 */
@EnableConfigurationProperties({PersonProperties.class}) //开启ConfigurationProperties注解
@ConfigurationProperties(prefix = "person")
//@PropertySource(value="classpath:application.properties", encoding="UTF-8")
public class PersonProperties {
    private int id;
    private String name;

    @Override
    public String toString() {
        return "SimpleBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
